package com.ruoyi.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.service.OrderRegisterAlipayRecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

/**
 * 支付宝对账
 */
@RestController
@RequestMapping("/hotel/order/registerAlipayRec")
public class OrderRegisterAlipayRecController extends BaseController {

    @Autowired
    OrderRegisterAlipayRecService orderRegisterAlipayRecService;

    /**
     * 查询支付宝对账数据
     * @param map
     * @return
     */
    @GetMapping("/getAlipayRecList")
    public AjaxResult getAlipayRecList(@RequestParam Map map) {
        return AjaxResult.success(orderRegisterAlipayRecService.getAlipayRecList(map));
    }

    /**
     * 根据id查询支付宝对账数据
     * @param id
     * @return
     */
    @GetMapping("/getAlipayRecById")
    public AjaxResult getAlipayRecById(@RequestParam String id) {
        return success(orderRegisterAlipayRecService.getAlipayRecById(id));
    }

    /**
     * 编辑支付宝对账数据
     * @param map
     * @return
     */
    @PostMapping("/postEditAlipayRec")
    public AjaxResult postEditAlipayRec(@RequestBody Map map) {
        return orderRegisterAlipayRecService.postEditAlipayRec(map);
    }

    /**
     * 新增支付宝对账数据
     * @param map
     * @return
     */
    @PostMapping("/postAddAlipayRec")
    public AjaxResult postAddAlipayRec(@RequestBody Map map) {
        return toAjax(orderRegisterAlipayRecService.postAddAlipayRec(map));
    }

    /**
     * 取消确认对账
     * @param map
     * @return
     */
    @PostMapping("/postCancelSeal")
    public AjaxResult postCancelSeal(@RequestBody Map map){
        return orderRegisterAlipayRecService.postCancelSeal(map);
    }

    /**
     * 确认对账
     * @param map
     * @return
     */
    @PostMapping("/postConfirmSeal")
    public AjaxResult postConfirmSeal(@RequestBody Map map){
        return orderRegisterAlipayRecService.postConfirmSeal(map);
    }

}
